package MapDemo;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MapEntrySetDemo {
    public static void main(String[] args) {
        Map<String, String> map = new HashMap<String, String>();
        map.put("李晨","范冰冰");
        map.put("邓超","孙俪");
        map.put("文章","马伊琍");
        map.put("汪峰","章子怡");
        Set<Map.Entry<String, String>> keyValues = map.entrySet();
        System.out.println(keyValues);
        for (Map.Entry<String, String> keyValue : keyValues) {
            String key = keyValue.getKey();
            String value = keyValue.getValue();
            System.out.println(key + "=" + value);
        }
    }
}
